package com.yuxi.main;

import com.yuxi.cache.CacheService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by yuxi on 2017/8/5.
 */
public class KnightMain {
    public static void main(String[] args) {
        // spring 应用上下文
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("knight.xml");
        //初始化 管理bean
//        Knight knight = (Knight) applicationContext.getBean("knight");
//        knight.embarkOnQuest();

//        Jugger jugger = (Jugger) applicationContext.getBean("jugger");
//        jugger.perform();
//
//        PoeticJugger poeticJugger = (PoeticJugger) applicationContext.getBean("poemJugger");
//        poeticJugger.perform();
//
//        Stage stage = (Stage) applicationContext.getBean("stage");


//        Instrumentlist instrumentlist = (Instrumentlist) applicationContext.getBean("instrumentList");
//        instrumentlist.perform();

        CacheService cacheService = (CacheService) applicationContext.getBean("cacheService");
        cacheService.getInfo(1);
        cacheService.getInfo(1);
        cacheService.getInfo(1);
        cacheService.getInfo(1);
        cacheService.getInfo(1);

        cacheService.getInfo2(1);
        cacheService.getInfo2(1);
        cacheService.getInfo2(1);
        cacheService.delete(1);
    }
}
